home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 4 / The Arsenal Files 4 (Arsenal Computer).ISO / casm / au116-as.exe / UTIL / LIST.CPP < prev    next >
C/C++ Source or Header  |  1994-12-13  |  629b  |  35 lines

  1. #include "..\au.hpp"
  2.  
  3. /*************************************************************************/
  4. void LISTPTR::add(char *string)
  5. {
  6.     LIST *temp;
  7.  
  8.     temp = new LIST;
  9.     temp->data = new char[strlen(string)+1];
  10.     strcpy(temp->data, string);
  11.     if (head == NULL)
  12.         head = tail = temp;
  13.     else
  14.     {
  15.         tail->next = temp;
  16.         tail = temp;
  17.     }
  18.     return;
  19. }
  20. /*************************************************************************/
  21. void LISTPTR::destroy()
  22. {
  23.     LIST *temp, *next;
  24.     temp = head;
  25.     while (temp != NULL)
  26.     {
  27.         next = temp->next;
  28.         delete [] temp->data;
  29.         delete temp;
  30.         temp = next;
  31.     }
  32.     reset();
  33.     return;
  34. }
  35.